package fileIO;

import org.apache.commons.io.FileUtils;

import java.io.*;
import java.util.Date;

/**
 * @description: TODO
 * @author: wzj
 * @create: 2018/12/12 10:24
 */
public class FileDemo {
    public static void main(String[] args) throws IOException {
        long l0=System.currentTimeMillis();
        FileWriter fileWriter=new FileWriter(new File("C:\\Users\\007\\Desktop\\11\\1.txt"));
        BufferedWriter bufferedWriter=new BufferedWriter(fileWriter);
        for(int i=0;i<1000000;i++){
            bufferedWriter.append("aaa"+i);
        }
        bufferedWriter.close();
        long l1=System.currentTimeMillis();
        System.out.println(l1-l0);

        FileWriter fileWriter1=new FileWriter(new File("C:\\Users\\007\\Desktop\\11\\11.txt"));
        for(int i=0;i<1000000;i++){
            fileWriter1.write("aaa"+i);
        }
        fileWriter1.close();
        System.out.println(System.currentTimeMillis()-l1);
    }
}

